﻿<%@ control language="C#" autoeventwireup="true" inherits="UserControls_SpecialOfferList, BtcHousing" %>
<%@ Register Src="~/UserControls/Pager.ascx" TagName="Pager" TagPrefix="UC" %>

 <asp:Repeater ID="rptSpecialOfferList" runat="server">
    <HeaderTemplate>                    
        <table cellpadding="3" cellspacing="0" class="GridView">                        
            <tr> 
                <%if (!this.IsPrivateList || WebUtil.IsAdministrator()) { %>
                <th>Company/Individual</th>
                <%} %>                
                <th>Offer</th> 
                <%--<th>Description</th>--%>
                <th>Type of Project</th>               
                <th>Picture</th>
                <th>Location</th>
                <th>Posted</th>
                <%if (this.IsPrivateList) { %>
                <th style="text-align:center;">Edit</th>
                <%} %>                
            </tr>
    </HeaderTemplate>
    <ItemTemplate>
        <tr class="EvenRowListing">
            <%if (!this.IsPrivateList || WebUtil.IsAdministrator()) { %>
            <td>
                <%# GetCompanyLinkOrName( 
                        App.Core.DB.NullHandler.GetString(DataBinder.Eval(Container.DataItem, "Name"))
                        , App.Core.DB.NullHandler.GetInt(DataBinder.Eval(Container.DataItem, "CustomerID"))
                        , App.Core.DB.NullHandler.GetBoolean(DataBinder.Eval(Container.DataItem, "IsIndividual"))
                ) %>
            </td>
            <%} %>                                      
            <td>
                <a href='/Pages/Public/SpecialOfferDetails.aspx?<%# AppConstants.QueryString.ID %>=<%# DataBinder.Eval(Container.DataItem, "ID")%>' target="_blank"><%# WebUtil.FormatText((String) DataBinder.Eval(Container.DataItem, "Title"))%></a>
            </td>            
            <%--<td><%# WebUtil.FormatText((String) DataBinder.Eval(Container.DataItem, "Description"))%></td>--%>
            <td><%# App.Core.DB.NullHandler.GetString(DataBinder.Eval(Container.DataItem, "ProjectType"))%></td>
            <td>
                <%# WebUtil.FormatImageField(AppConstants.SPECIAL_OFFER_IMAGES, DataBinder.Eval(Container.DataItem, "PictureThumb"))%>                        
            </td>
            <td><%# App.Core.DB.NullHandler.GetString(DataBinder.Eval(Container.DataItem, "Location"))%></td>
            <td><%# App.Core.DB.NullHandler.GetDateTime(DataBinder.Eval(Container.DataItem, "Created")).ToString(AppConstants.ValueOf.DATE_FROMAT_DISPLAY)%></td>
            <%if (this.IsPrivateList) { %>
            <td style="text-align:center;">                
                <a href='/Pages/Private/SpecialOfferChange.aspx?<%# AppConstants.QueryString.ID %>=<%# DataBinder.Eval(Container.DataItem, "ID")%>'>Edit</a>                
            </td>
            <%} %>
        </tr>
    </ItemTemplate> 
    <AlternatingItemTemplate>
        <tr class="OddRowListing">
            <%if (!this.IsPrivateList || WebUtil.IsAdministrator()) { %>
            <td>
                <%# GetCompanyLinkOrName( 
                        App.Core.DB.NullHandler.GetString(DataBinder.Eval(Container.DataItem, "Name"))
                        , App.Core.DB.NullHandler.GetInt(DataBinder.Eval(Container.DataItem, "CustomerID"))
                        , App.Core.DB.NullHandler.GetBoolean(DataBinder.Eval(Container.DataItem, "IsIndividual"))
                ) %>
            </td>
            <%} %>                                      
            <td>
                <a href='/Pages/Public/SpecialOfferDetails.aspx?<%# AppConstants.QueryString.ID %>=<%# DataBinder.Eval(Container.DataItem, "ID")%>' target="_blank"><%# WebUtil.FormatText((String) DataBinder.Eval(Container.DataItem, "Title"))%></a>
            </td>            
            <%--<td><%# WebUtil.FormatText((String) DataBinder.Eval(Container.DataItem, "Description"))%></td>--%>
            <td><%# App.Core.DB.NullHandler.GetString(DataBinder.Eval(Container.DataItem, "ProjectType"))%></td>
            <td>
                <%# WebUtil.FormatImageField(AppConstants.SPECIAL_OFFER_IMAGES, DataBinder.Eval(Container.DataItem, "PictureThumb"))%>                        
            </td>
            <td><%# App.Core.DB.NullHandler.GetString(DataBinder.Eval(Container.DataItem, "Location"))%></td>
            <td><%# App.Core.DB.NullHandler.GetDateTime(DataBinder.Eval(Container.DataItem, "Created")).ToString(AppConstants.ValueOf.DATE_FROMAT_DISPLAY)%></td>
            <%if (this.IsPrivateList) { %>
            <td style="text-align:center;">                
                <a href='/Pages/Private/SpecialOfferChange.aspx?<%# AppConstants.QueryString.ID %>=<%# DataBinder.Eval(Container.DataItem, "ID")%>'>Edit</a>                
            </td>
            <%} %>
        </tr>
    </AlternatingItemTemplate>               
    <FooterTemplate>
        </table>
    </FooterTemplate>
</asp:Repeater>                 
        
<div style="margin-top:10px;">
    <UC:Pager ID="ucSpecialOfferListPager" runat="server" OnPageIndexChanged="ucSpecialOfferListPager_PageIndexChanged" />
</div>
<div id="divMessage" runat="server" enableviewstate="false" visible="false"></div>

